smoothTimeSeries <- function(timePoints,peakLocations,bandwidth,use.log = T,type = "gaussian"){
    Y <- matrix(0,nrow = length(timePoints),ncol = length(peakLocations))
    colnames(Y) <- as.character(peakLocations) 
 

    if(type == "gaussian"){

        if(use.log){
            for(ii in 1:dim(Y)[1]){
                Y[ii,] <- exp(-((((log2(peakLocations)) - log2(timePoints[ii]))^2))/log2(bandwidth)^2)
            }
        }
        else{
            for(ii in 1:dim(Y)[1]){
                Y[ii,] <- exp(-((((peakLocations) - timePoints[ii])^2))/bandwidth^2)
            }    
        }
    }
    
    if(type == "sigmoid"){
        for(ii in 1:dim(Y)[1]){
	    Y[ii,] <- 1/(1 + exp(-(((timePoints[ii]-peakLocations)))/bandwidth))
        }
    }        
    
    return(Y)
}    
